package com.lyf.boot.listener;

import com.lyf.boot.constant.RabbitMqConstant;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * 消息监听
 * @author Luyufan
 * @date 2023/7/10 18:03
 */
@Component
@Slf4j
@RabbitListener(queues = RabbitMqConstant.ONE_TO_ONE_QUEUE)
public class MessageListener {

    @RabbitHandler
    public void receive(String message){
        log.info("message is {}", message);
    }
}
